//
//  SpositionTableViewCell.m
//  u76ho
//
//  Created by m-air-01 on 16/1/30.
//  Copyright © 2016年 LV. All rights reserved.
//

#import "SpositionTableViewCell.h"
@implementation SpositionTableViewCell

- (void)awakeFromNib {
    // Initialization code
    _headerImgV.layer.masksToBounds = YES;
    _headerImgV.layer.cornerRadius = _headerImgV.frame.size.height/2;
}

-(void)setModel:(SPositionModel *)model
{
    _model = model;
    
    [_headerImgV sd_setImageWithURL:[NSURL URLWithString:[NSString stringWithFormat:@"%@%@",U76HOURL,model.ico]] placeholderImage:[UIImage imageNamed:@"发现－默认logo"]];
    
    _dutyLab.text = model.dutyname;
    _companyNameLab.text = model.companyname;
    
    NSString * str = [NSString stringWithFormat:@"%@ | %@ | %@",model.city,model.years,model.education];
    _otherLab.text = str;
    
    //时间
    NSDateFormatter * formatter = [[NSDateFormatter alloc]init];
    formatter.dateFormat = @"yyyy-MM-dd";
    NSString * dataCh = model.addtime;
    NSString * dataStr = [dataCh substringToIndex:dataCh.length];
    NSDate * data = [[NSDate dateWithTimeIntervalSince1970:[dataStr integerValue]] dateByAddingTimeInterval:8*3600];
    NSString * lastStr = [NSString stringWithFormat:@"%@",data];
    NSArray * lastArr = [lastStr componentsSeparatedByString:@" "];
    _dateLab.text = lastArr[0];
    
    NSString * salaryStr = model.salary;
    _salaryLab.text = salaryStr;
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
